#ifndef __TRACE_H__
#define __TRACE_H__

#include <stdio.h>
#include <stdlib.h>

#include "simutils.h"

typedef enum trace_operation_e
{
	TO_MinimumValue = 0,
	TO_Load = 0,
	TO_Store,
	TO_Branch,
	TO_Computation,
	TO_NumValues,
	TO_InvalidValue
}opcode;
extern char * instrTypes[];
// Union for the three possible execution info types
typedef union
{
	uint32 ldstAddr;
	uint32 brTaken;
	uint32 compLatency;
} execution_info;

// Struct to represent an instruction read in from trace
typedef struct
{
	enum trace_operation_e opType;
	uint32 pc;
	execution_info exInfo;
} instruction;

static FILE* TraceFile = 0;

int openTraceFile(char * filename);

int getInstruction(instruction* instr, results_s* results);
void printInstruction(instruction* instr);



#endif // __TRACE_H__
